Migrate burl example to capy post-#262 buffer API#161
Merged
Conversation
cppalliance/capy#262 removes the `slice_of<>` class template and the slice CPOs (`prefix`, etc.). The `burl` example's `any_stream` type-erasure used both: - The virtual `async_write_some`/`async_read_some` signatures took `capy::slice_of<boost::span<capy::const_buffer const>>`/`mutable` parameters. - The outer rate-limited templates used `capy::prefix(buffers, n)` to limit each underlying call to the remaining byte budget. Migration: - Change the virtual signatures to take the underlying `boost::span<X const>` directly, plus a `std::size_t max_bytes` parameter carrying the byte budget. The implementation wraps the span in `capy::buffer_slice(span, 0, max_bytes)` and forwards `s.data()` to the inner stream. - The outer templates pass `buffers, wr_remain_` / `buffers, rd_remain_` directly through the virtual; the slicing happens on the receiving side. - Replace the `<boost/capy/buffers/slice.hpp>` include with `<boost/capy/buffers/buffer_slice.hpp>`. The `burl` example remains disabled in CMake (pre-existing — its asio dependency requires a `boost::asio::any_completion_handler.hpp` that isn't in the pinned asio build). This migration keeps the source in sync with the new capy API so it can be re-enabled when the asio dependency is resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cppalliance/capy#262 removes the
slice_of<>class template and the slice CPOs (prefix, etc.). Theburlexample'sany_streamtype-erasure used both:async_write_some/async_read_somesignatures tookcapy::slice_of<boost::span<capy::const_buffer const>>/mutableparameters.capy::prefix(buffers, n)to limit each underlying call to the remaining byte budget.Migration:
boost::span<X const>directly, plus astd::size_t max_bytesparameter carrying the byte budget. The implementation wraps the span incapy::buffer_slice(span, 0, max_bytes)and forwardss.data()to the inner stream.buffers, wr_remain_/buffers, rd_remain_directly through the virtual; the slicing happens on the receiving side.<boost/capy/buffers/slice.hpp>include with<boost/capy/buffers/buffer_slice.hpp>.The
burlexample remains disabled in CMake (pre-existing — its asio dependency requires aboost::asio::any_completion_handler.hppthat isn't in the pinned asio build). This migration keeps the source in sync with the new capy API so it can be re-enabled when the asio dependency is resolved.